{extend name="public/base" /}

{block name="title"}<title>下个月奖扣任务配置人员列表</title>{/block}

{block name="pjax_container"}
<style>
 tr>th,
    td {
        text-align: center;
    }

    .btn-group-xs>.btn,
    .btn-xs {
        padding: 5px;
        margin: 0 5px;
    }



    .content-header>.breadcrumb>li {
        color: #999;
    }

    .content-header>.breadcrumb>.active {
        color: #666;
    }

    .content-header {
        height: 51px;

    }

    .btn-primary {
        background-color: #1890FF;
        color: #fff;
        border: none;
        border-radius: 6px !important;
        margin-left: 15px;
        padding: 5px 10px;
        line-height: 24px;
    }

    .box-primary {
        border-top-color: #ecf0f5 !important;
        border-top-width: 16px;

    }

    .btn-primary:hover {
        background-color: #1890FF;
        color: #fff;
        border: none;
        opacity: .9;
        border-radius: 6px !important;
    }

    .delete-one {
        background-color: ff4141 !important;
        margin-left: 15px;
        border-radius: 6px;
    }

    .sreachs {
        background-color: #1890FF;
        color: #fff;
        border: none;
        border-radius: 6px !important;
        margin-left: 15px;
        padding: 7px 15px;
    }

    .type_explode {
        color: #fff;
        background-color: #d9534f;
        border-radius: 6px;
        border: none;  
    }
    .nav-tabs-custom{
        margin-top: 16px;
    }

</style>
<section class="content-header">
    <ol class="breadcrumb">
        <li>奖扣任务</li>
        <li>奖扣任务配置</li>
        <li class="active">下个月奖扣任务配置人员列表</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <div class="pull-left">
                        {:authAction(CONTROLLER_NAME.'/user_next_edit','create',['id'=>$id])}
                    </div>
                    <ul class="nav nav-tabs">
                        <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm" style="padding:10px 2px;"><i class="fa fa-list"></i> 返回</a></li>
                    </ul>
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover">
                        <tr>
                            <th>头像</th>
                            <th>名称</th>
                            <th>部门</th>
                            <th>操作</th>
                        </tr>
                        {volist name="$list" id="v"}
                        <tr>
                            <td><img src="{$v['avatar']}" style="width: 50px;height: 50px"/></td>
                            <td>{$v.name}</td>
                            <td>{$v.department_name}</td>
                            <td>
                                {:authAction(CONTROLLER_NAME.'/user_next_del','delete_one',['id'=>$v['id']])}
                            </td>
                        </tr>
                        {/volist}
                    </table>
                </div>
                <div class="box-footer clearfix">
                    {$list->render()}
                </div>
            </div>
        </div>
    </div>
</section>
<script>
    $(function(){
        // 列表部分 全选
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue',
            radioClass: 'iradio_minimal-blue'
        });
        $('.checkbox-toggle').on('ifChecked', function(event){
            var _this = $(this);
            var _table = _this.closest('.table');
            _table.find("tr td input[type='checkbox']").iCheck("check");
        });
        $('.checkbox-toggle').on('ifUnchecked', function(event){
            var _this = $(this);
            var _table = _this.closest('.table');
            _table.find("tr td input[type='checkbox']").iCheck("uncheck");
        });
    });
    function change_status(id) {
        $.ajax({
            url:"{:url('change_status')}",
            type:'post',
            data:{'id':id},
            success:function (res) {
                $.amaran({'message': res.msg});
                if(res.err == 0){
                    window.location.reload()
                }
            }
        });
    }
</script>
{/block}
